import numpy as np
import torch
import random
import math
import torch.nn.functional as F
import matplotlib.pyplot as plt
import re
import torch.nn as nn
import copy
import warnings
import copy

origin = [1, 2, [3, 4]]
cop1 = origin
cop2 = copy.deepcopy(origin)
cop3 = copy.copy(origin)  # 存储的是地址origin的地址，当解析的时候还是会指向origin
print(cop1 == cop2)  # 判断值是否相等
print(cop1 is cop2)  # is 是判断地址是否相当的
print(id(origin), id(cop1), id(cop2), id(cop3))
#cop1 和 cop2 看上去相同，但已不再是同一个object
origin[2][0] = "hey!"
print('origin', origin)
print('cop1', cop1)
print('cop3', cop3)
print('cop2', cop2)


